package com.oyesgo.statistics.thread;

import java.util.List;

import com.oyesgo.statistics.dao.LogInfoDao;
import com.oyesgo.statistics.dao.impl.LogInfoJdbcDaoImpl;
import com.oyesgo.statistics.log.LogUtils;
import com.oyesgo.statistics.model.LogInfo;

/**
 * @FileName ToDBThread.java
 * @Description: 入库线程
 * @author rose
 * @version 1.0
 * <p>Company: OYESGO</p>
 * <p>Copyright: Copyright (c) 2010</p>
 */
public class ToDBThread implements Runnable{
	public static final String NAME = "入库线程";
	public static final String START = "开启";
	public static final String SHUTDOWN = "关闭";
	public int a;
	private LogInfoDao dao;
	private List<LogInfo> logInfoList;
	public ToDBThread(){}
	public ToDBThread(int a,List<LogInfo> logInfoList){
		this.a = a;
		this.logInfoList = logInfoList;
	}
	public void run() {
		LogUtils.printlnToFile("["+NAME+a+START+"]");
		dao = new LogInfoJdbcDaoImpl();
		dao.insertList(logInfoList);
		LogUtils.printlnToFile("["+NAME+a+SHUTDOWN+"]");
	}
}
